package 作业;

class Person implements Comparable<Person>
    {
    private int idCard;
    private String userName;
    // 以下是getter和setter方法
    // 省略

        @Override
        public int compareTo(Person o) {
            return o.idCard - this.idCard;//
        }

        public Person() {
    }

    public Person(int idCard, String userName) {
        this.idCard = idCard;
        this.userName = userName;
    }

    public int getIdCard() {
        return idCard;
    }

    public void setIdCard(int idCard) {
        this.idCard = idCard;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}
